{#**
 * 2007-2020 PrestaShop SA and Contributors
 *
 * NOTICE OF LICENSE
 *
 * This source file is subject to the Open Software License (OSL 3.0)
 * that is bundled with this package in the file LICENSE.txt.
 * It is also available through the world-wide-web at this URL:
 * https://opensource.org/licenses/OSL-3.0
 * If you did not receive a copy of the license and are unable to
 * obtain it through the world-wide-web, please send an email
 * to license@prestashop.com so we can send you a copy immediately.
 *
 * DISCLAIMER
 *
 * Do not edit or add to this file if you wish to upgrade PrestaShop to newer
 * versions in the future. If you wish to customize PrestaShop for your
 * needs please refer to https://www.prestashop.com for more information.
 *
 * @author    PrestaShop SA <contact@prestashop.com>
 * @copyright 2007-2020 PrestaShop SA and Contributors
 * @license   https://opensource.org/licenses/OSL-3.0 Open Software License (OSL 3.0)
 * International Registered Trademark & Property of PrestaShop SA
 *#}
{% extends '@PrestaShop/Admin/Module/common.html.twig' %}

{% block content %}
  <div class="row justify-content-center">
    <div class="col-lg-10">
      {# Bulk Action confirm modal #}
      {% include '@PrestaShop/Admin/Module/Includes/modal_confirm_bulk_action.html.twig' %}
      {# PrestaTrust modal #}
      {% include '@PrestaShop/Admin/Module/Includes/modal_confirm_prestatrust.html.twig' %}
      {# Addons connect modal with level authorization#}
      {% include '@PrestaShop/Admin/Module/Includes/modal_addons_connect.html.twig' with { 'level' : level, 'errorMessage' : errorMessage } %}
      {# Contains toolbar-nav for module page with level authorization #}
      {% include '@PrestaShop/Admin/Module/Includes/modal_import.html.twig' with { 'level' : level, 'errorMessage' : errorMessage } %}
      {# Contains menu with Selection/Categories/Popular and Tag Search #}
      {% include '@PrestaShop/Admin/Module/Includes/menu_top.html.twig' with { 'topMenuData': topMenuData, 'bulkActions': bulkActions } %}

      {% include '@PrestaShop/Admin/Module/Includes/grid_manage_recently_used.html.twig' with { 'display_type': 'list', 'origin': 'manage' } %}

      {% block catalog_categories_listing %}
        {% for category in categories.subMenu %}
          <div class="module-short-list">
            <span id="{{ category.refMenu }}_modules" class="module-search-result-title">{{ category.name | trans({}, 'Admin.Modules.Feature') }}</span>

            {% if category.modules is empty %}
              {% include '@PrestaShop/Admin/Module/Includes/grid_manage_empty.html.twig' with { 'category': category, 'display_type': 'list', 'origin': 'manage' } %}
            {% else  %}
              {% include '@PrestaShop/Admin/Module/Includes/grid_manage_installed.html.twig' with { 'modules': category.modules, 'display_type': 'list', 'origin': 'manage', 'id': category.refMenu } %}

              {% block addon_card_see_more %}
                {% if (category.modules | length) > maxModulesDisplayed %}
                  {% include '@PrestaShop/Admin/Module/Includes/see_more.html.twig' with { 'id': category.refMenu } %}
                {% endif %}
              {% endblock %}
            {% endif %}
          </div>
        {% endfor %}
      {% endblock %}
    </div>
  </div>
{% endblock %}
